import React from 'react'
import ReactDOM from 'react-dom/client'

import App from './App'

// 5. 导入 store
import store from './store/transit'
import { Provider } from 'react-redux'

const root = ReactDOM.createRoot(document.getElementById('root'))

root.render(
    <React.StrictMode>
        <Provider store={store}>
            <App />
        </Provider>
    </React.StrictMode>
)

// 6. 监听 store 变化重新渲染
// store.subscribe(() => {
//     root.render(<App />)
// })